Skip to content

Conversation

@Oppen
Copy link
Contributor

@Oppen Oppen commented Oct 2, 2025

A brief pros and cons list to decide whether to turn off optimistic
transactions.

A brief pros and cons list to decide whether to turn off optimistic
transactions.
@Oppen Oppen requested a review from a team as a code owner October 2, 2025 18:36
Copilot AI review requested due to automatic review settings October 2, 2025 18:36
@github-actions github-actions bot added the L1 Ethereum client label Oct 2, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds an internal documentation page outlining pros/cons of using Optimistic, Pessimistic, or Non-Transactional RocksDB modes to inform a decision about disabling optimistic transactions.

  • Introduces advantages sections for each transaction mode plus non-transactional usage
  • Lists potential alternatives to using DB-level transactions
  • Highlights operational considerations for crash recovery and L2 constraints

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -0,0 +1,21 @@
# Tradeoffs of using or not Optimistic Transaction DB in RocksDB
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heading is grammatically awkward; consider rephrasing for clarity.

Suggested change
# Tradeoffs of using or not Optimistic Transaction DB in RocksDB
# Tradeoffs of Using Optimistic Transaction DB Versus Not Using It in RocksDB

Copilot uses AI. Check for mistakes.
- Easier to keep consistency with readers.

## Advantages of Pessimistic Transactions
- Lower memory usage?
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trailing question mark signals uncertainty. Either provide data/supporting rationale or remove the entry until confirmed.

Suggested change
- Lower memory usage?
- Lower memory usage (confirm).

Copilot uses AI. Check for mistakes.

## Advantages of Non-Transactional DB
- `delete_range`: much faster key deletion in bulk, useful during healing.
- Lower memory usage (confirm).
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The '(confirm)' note indicates an unverified claim; replace with concrete information or remove pending validation.

Suggested change
- Lower memory usage (confirm).
- Lower memory usage.

Copilot uses AI. Check for mistakes.
## Advantages of Non-Transactional DB
- `delete_range`: much faster key deletion in bulk, useful during healing.
- Lower memory usage (confirm).
- Secondary instances are either much easier or possible.
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sentence is ambiguous ('either much easier or possible'). Clarify whether non-transactional mode enables secondary instances at all, or simply reduces complexity.

Suggested change
- Secondary instances are either much easier or possible.
- Secondary instances are only possible in non-transactional mode.

Copilot uses AI. Check for mistakes.
- We can provide crash safety by adding checkpoints or explicit markers so we can go back to the last known consistent version.
- We would need to run a healing pass from that point on startup, to fix possible partial changes to tries.
- We would need to add explicit tests for crashing during writes to make sure we recover correctly.
- L2 can't recover from peers (at least until Based), so it should probably remain transactional.
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Term 'Based' is unexplained; add a brief definition or link so readers understand the dependency or future milestone.

Suggested change
- L2 can't recover from peers (at least until Based), so it should probably remain transactional.
- L2 can't recover from peers (at least until Based[^based]), so it should probably remain transactional.

Copilot uses AI. Check for mistakes.
Comment on lines +12 to +20
- `delete_range`: much faster key deletion in bulk, useful during healing.
- Lower memory usage (confirm).
- Secondary instances are either much easier or possible.

## Alternatives to DB Transactions
- We can use snapshots/secondary instances to provide a consistent view to block production and protocols.
- We can provide crash safety by adding checkpoints or explicit markers so we can go back to the last known consistent version.
- We would need to run a healing pass from that point on startup, to fix possible partial changes to tries.
- We would need to add explicit tests for crashing during writes to make sure we recover correctly.
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider explicitly listing required additional mechanisms (healing pass, crash tests, checkpoints) as 'Operational Requirements' to distinguish them from 'Advantages'; current mix may confuse readers about what is a benefit vs. a cost.

Suggested change
- `delete_range`: much faster key deletion in bulk, useful during healing.
- Lower memory usage (confirm).
- Secondary instances are either much easier or possible.
## Alternatives to DB Transactions
- We can use snapshots/secondary instances to provide a consistent view to block production and protocols.
- We can provide crash safety by adding checkpoints or explicit markers so we can go back to the last known consistent version.
- We would need to run a healing pass from that point on startup, to fix possible partial changes to tries.
- We would need to add explicit tests for crashing during writes to make sure we recover correctly.
- Lower memory usage (confirm).
- Secondary instances are either much easier or possible.
## Operational Requirements for Non-Transactional DB
- Healing pass: On startup, a healing pass must be run from the last checkpoint to fix possible partial changes to tries.
- Crash safety: Explicit tests for crashing during writes are needed to ensure correct recovery.
- Checkpoints: Crash safety can be provided by adding checkpoints or explicit markers to allow rollback to the last known consistent version.
- `delete_range`: Used for much faster key deletion in bulk, which is especially useful during the healing process.
## Alternatives to DB Transactions
- We can use snapshots/secondary instances to provide a consistent view to block production and protocols.

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +20
- We can use snapshots/secondary instances to provide a consistent view to block production and protocols.
- We can provide crash safety by adding checkpoints or explicit markers so we can go back to the last known consistent version.
- We would need to run a healing pass from that point on startup, to fix possible partial changes to tries.
- We would need to add explicit tests for crashing during writes to make sure we recover correctly.
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider explicitly listing required additional mechanisms (healing pass, crash tests, checkpoints) as 'Operational Requirements' to distinguish them from 'Advantages'; current mix may confuse readers about what is a benefit vs. a cost.

Suggested change
- We can use snapshots/secondary instances to provide a consistent view to block production and protocols.
- We can provide crash safety by adding checkpoints or explicit markers so we can go back to the last known consistent version.
- We would need to run a healing pass from that point on startup, to fix possible partial changes to tries.
- We would need to add explicit tests for crashing during writes to make sure we recover correctly.
- We can use snapshots/secondary instances to provide a consistent view to block production and protocols.
## Operational Requirements for Non-Transactional DB
- We can provide crash safety by adding checkpoints or explicit markers so we can go back to the last known consistent version.
- We would need to run a healing pass from that point on startup, to fix possible partial changes to tries.
- We would need to add explicit tests for crashing during writes to make sure we recover correctly.

Copilot uses AI. Check for mistakes.
@MegaRedHand MegaRedHand changed the title doc(l1): tradeoffs of transactional RocksDB modes docs(l1): tradeoffs of transactional RocksDB modes Oct 2, 2025
@github-project-automation github-project-automation bot moved this to In Review in ethrex_l1 Oct 6, 2025
@jrchatruc jrchatruc added this pull request to the merge queue Oct 6, 2025
Merged via the queue into main with commit 3dfc3a0 Oct 6, 2025
45 of 46 checks passed
@jrchatruc jrchatruc deleted the docs/transactions_tradeoffs branch October 6, 2025 22:12
@github-project-automation github-project-automation bot moved this from In Review to Done in ethrex_l1 Oct 6, 2025
Peponks9 pushed a commit to Peponks9/ethrex that referenced this pull request Oct 7, 2025
A brief pros and cons list to decide whether to turn off optimistic
transactions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants